<template>
  <van-dialog
  use-slot
  :show="visible"
  show-cancel-button
  :showConfirmButton="false"
  @close="visible = false"
>
  <van-image  fit="cover" width="360rpx" height="360rpx" :src="qrcode" />
</van-dialog>
</template>

<script>
import vueQr from '@/static/js/weapp-qrcode';
export default {
  data(){
      return{
          visible: false,
          qrcode: '/#'
      }
  },
  methods:{
    init(id){
      this.qrcode = vueQr.drawImg(id, {
        typeNumber: 4,
        errorCorrectLevel: 'M',
        size: 300
      });
      this.visible = true;         
    },
    // createQrcode(id){      
    //   this.$http('get', '/common/getQrcode', {path: '/packageB/activity/list', size: 400}, (data,msg) => {
    //     this.qrcode = data;
    //   })
    // }
  }
}
</script>